<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable = no">
		<title></title>
		<link rel="stylesheet" type="text/css" href="../_public/css/css.css">
		<script type="text/javascript" src="../_public/js/jquery-2.1.4.min.js"></script>
		<script type="text/javascript" src="../_public/js/tigerUI_640.js"></script>
		<script type="text/javascript" src="../_public/js/babylon.2.2.js"></script>
		<style type="text/css">
			html, body {
			    overflow: hidden;
			    width   : 100%;
			    height  : 100%;
			    margin  : 0;
			    padding : 0;
			}
			
			#renderCanvas {
			    width   : 100%;
			    height  : 100%;
			    touch-action: none;
			}
		</style>
	</head>
	<body>
    	<canvas id="renderCanvas"></canvas>
		<script type="text/javascript">
	        window.addEventListener('DOMContentLoaded', function(){
	            var canvas = document.getElementById('renderCanvas');
	            var engine = new BABYLON.Engine(canvas, true);
	            var createScene = function(){
	                //场景
	                var scene = new BABYLON.Scene(engine);
	
	                //相机
	                var camera = new BABYLON.FreeCamera('camera1', new BABYLON.Vector3(0, 5,-10), scene);
	                    camera.setTarget(BABYLON.Vector3.Zero());
	                    camera.attachControl(canvas, false);
	
	                //灯光
	                var light = new BABYLON.HemisphericLight('light1', new BABYLON.Vector3(0,1,0), scene);
	
	                //物体
	                var sphere = new BABYLON.Mesh.CreateSphere('sphere1', 16, 2, scene);
	                    sphere.position.y = 1;
	
	                //地平面
	                var ground = new BABYLON.Mesh.CreateGround('ground1', 6, 6, 2, scene);
	
	                return scene;
	            }
	
	            var scene = createScene();
	            
	            engine.runRenderLoop(function(){
	                scene.render();
	            });
	            
	            window.addEventListener('resize', function(){
	                engine.resize();
	            });
	        });
		</script>
	</body>
</html>
